/*
    Linear Programming Library
    
    Created by Team Paragon (Shena Hoffmann, Arthur Powalka, Nasir Kenarangui)
    CSCE 689
    
    RevSimplex.h
    Declares the variables and functions used for providing functionality related to the revised simplex linear programming algorithm
*/

#ifndef RevSimplex_H    //ensure that RevSimplex is only included once
#define RevSimplex_H

#include <iostream>
#include <algorithm>
#include <math.h>
#include <tuple>
#include <armadillo>
#include "LinProg.h"

using namespace arma;

class RevSimplex : public LinProg
{
private:
    // ............ PRIVATE CLASS VARIABLES ............ //
    vector< complex<double> > complexObjective;
    mat C;
    mat A;
    mat b;
    uvec B;
    vector< complex<double> > convertObjectiveToComplexForm(vector<double> oldObjective);
    
    // ............ HELPER FUNCTIONS ............ //
    void setClassVariables(LinProg &obj);
    void setClassVariables(RevSimplex &obj);
            
public:
    // ............ CONSTRUCTORS ............ //
    RevSimplex();
    RevSimplex(const LinProg &lp);
    RevSimplex(const RevSimplex &lp);
    RevSimplex(bool max, vector<double> objective, vector<vector<double>> constraints, vector<string> inequalitySigns, vector<double> inequalityVals, vector<bool> constrainedVars);

    // ............ DESTRUCTOR ............ //
    ~RevSimplex();		
    
    // ............ FUNCTIONS FOR THE USER ............ //
    tuple<vector<double>, string, double> solve();
    template<typename type>
    void printVector(vector<type> vec);
    RevSimplex convertToRsimplexForm();
    
    // ............ OVERLOADED OPERATORS ............ //
    RevSimplex operator=(const RevSimplex &lp);
};
#endif
